package com.hdi.extendsconstructor;

import javax.lang.model.element.NestingKind;

public class Test3 {
    public static void main(String[] args) {
        // 3.this(...)调用兄弟构造器
        // 需求：默认没有填写学下，就默认 蓝翔技校
        Student student = new Student("张庆",38,"家里蹲大学");

        System.out.println(student.getName());
        System.out.println(student.getAge());
        System.out.println(student.getSchoolName());

        Student s2 = new Student("王二",24);
        System.out.println(s2.getAge());
        System.out.println(s2.getName());
        System.out.println(s2.getSchoolName());
        int[] arr = {12};
    }

}
class  Student {
    private String name;
    private int age;
    private String schoolName;

    public Student(){

    }

    public Student(String name,int age){
        this(name,age,"蓝翔技校");
    }

    public Student(String name, int age, String schoolName) {
        this.name = name;
        this.age = age;
        this.schoolName = schoolName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSchoolName() {
        return schoolName;
    }

    public void setSchoolName(String schoolName) {
        this.schoolName = schoolName;
    }
}
